<?php echo "<script>passError = '"."'</script>"; ?>
<?php echo "<script>mailError = '"."'</script>"; ?>

<div class="navbar navbar-fixed-top" >
	<div class="navbar-inner">
		<div class="container">
			<a class="brand" href="?home">
				movienight
			</a>
			
			<?php if($session->logged_in) { ?>
			
				<ul class="nav">
					<li class="active"><a href="?home">Home</a></li>
					<li><a href="?create">Create movienight</a></li>
				</ul>
			
				<div class="btn-group pull-right">
					<button class="btn btn-primary">
						<i class="icon-user icon-white"></i> <?php echo $session->userinfo['firstname']." ".$session->userinfo['lastname']; ?>
					</button>
					<button class="btn dropdown-toggle btn-primary" data-toggle="dropdown">
						<span class="caret"></span>
					</button>
					<ul class="dropdown-menu">
						<li><a href="#">Edit Profile</a></li>
						<li><a href="#">Help</a></li>
						<li class="divider"></li>
						<li><a href="process.php">Log out</a></li>
					</ul>
				</div>
			<?php } else { ?>
			<?php echo "<script>passError = '".strip_tags($form->error("login_pass"))."'</script>"; ?>
			<?php echo "<script>mailError = '".strip_tags($form->error("login_email"))."'</script>"; ?>
				<form class="pull-right navbar-search form-inline" action="process.php" method="POST">
					<input type="text" class="search-query span2" placeholder="Email" id="login_email" name="login_email">
					<input type="password" class="search-query span2" placeholder="Password" id="login_pass" name="login_pass">
					<label class="checkbox">
						<input type="checkbox" name="remember"> Remember me
					</label>
					<button type="submit" class="btn-small">Sign in</button>
					<input type="hidden" name="referrer" value="index.php">
					<input type="hidden" name="sublogin" value="1">	
				</form>
			<?php } ?>
		</div>
	</div>
</div>